package fr.inserm.u674.chcdbweb.model.feed;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.LinkedHashMap;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;


public abstract class AbstractFeeder {

	public LinkedHashMap<String, String> analyzeFile(String xlsxFile) throws FileNotFoundException,
		IOException, InvalidFormatException {
		LinkedHashMap<String, String> importFileInfo = new LinkedHashMap<String, String>();

		String tmpdir = System.getProperty("java.io.tmpdir");
		File importFile = new File(tmpdir + File.separator + xlsxFile);

		importFileInfo.put("File Name", importFile.getName());
		Long length = importFile.length();
		importFileInfo
			.put("File Size", Float.toString(length.floatValue() / (1024 * 1024)) + " MB");

		return importFileInfo;
	}
	
	

}
